package com.wc.alorithm_blue_bridge._前缀和与差分.Q3220;

import java.io.*;

/**
 * @Author congege
 * @Description
 *
 * 小蓝学位运算
 * @Date Created in 2023/11/25-21:15
 */
public class Main {
    public static void main(String[] args){
        Input sc = new Input();
        int n = sc.nextInt();
        int mod = (int) 1e9 + 7;
        int[] array = new int[n + 1];
        int[] pre = new int[n + 1];
        for(int i = 1; i <= n; i++){
            array[i] = sc.nextInt();
            pre[i] = pre[i - 1] ^ array[i];
        }
        if(n > 8192){
            System.out.println(0);
            return;
        }
        long ans = 1;
        for(int l = 1; l <=n; l++){
            for(int r = l; r <= n; r++){
                ans = ans * (pre[l - 1] ^ pre[r]) % mod;
            }
        }
        System.out.println(ans);
    }

    static class Input{
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt(){
            try {
                in.nextToken();
            }catch (Exception e){
                return -1;
            }
            return (int) in.nval;
        }
    }
}
